import { createApp } from "vue"
import App from "./App.vue"
import router from "./router"
import store from "./store"
import { library } from "@fortawesome/fontawesome-svg-core"
import { fas } from '@fortawesome/free-solid-svg-icons';
import {
  faChartLine,
  faFileAlt,
  faBrain,
  faCog,
  faCloudUploadAlt,
  faCopy,
  faDownload,
  faMagic,
  faFileExcel,
  faFolderOpen,
  faTimes,
  faCheckCircle,
  faListCheck,
  faTable,
  faArrowUp,
  faArrowDown,
  faArrowLeft,  // 添加缺失的图标
  faUser,       // 添加可能需要的用户图标
  faLock        // 添加可能需要的锁图标
} from "@fortawesome/free-solid-svg-icons"
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome"

// 注册图标
library.add(
  faChartLine,
  faFileAlt,
  faBrain,
  faCog,
  faCloudUploadAlt,
  faCopy,
  faDownload,
  faMagic,
  faFileExcel,
  faFolderOpen,
  faTimes,
  faCheckCircle,
  faListCheck,
  faTable,
  faArrowUp,
  faArrowDown,
  faArrowLeft,  // 添加缺失的图标
  faUser,       // 添加可能需要的用户图标
  faLock        // 添加可能需要的锁图标
)

const app = createApp(App)

// 添加全局错误处理
app.config.errorHandler = (err, vm, info) => {
  console.error('Vue错误:', err)
  console.log('错误信息:', info)
  // 可以在这里添加错误上报逻辑
}
library.add(fas);

// 在 Vue 实例中全局注册 FontAwesomeIcon 组件
app.component('font-awesome-icon', FontAwesomeIcon);

// 注册全局组件
app.component("font-awesome-icon", FontAwesomeIcon)

app.use(router)
app.use(store)

app.mount("#app")
